//
//  WmcLocateGuideTipView.swift
//  YPWatermarkCamera
//
//  Created by 周诗松 on 2022/7/6.
//

import UIKit

class WmcLocateGuideTipView: WmcBaseView {
    // Internal

    override func makeUI() {
        backgroundColor = .clear
        
        addSubview(bgImageView)
        addSubview(tipLabel)

        bgImageView.snp.makeConstraints { make in
            make.left.top.right.bottom.equalToSuperview()
        }

        tipLabel.snp.makeConstraints { make in
            make.left.top.equalTo(8)
            make.right.equalTo(-8)
            make.bottom.equalTo(-14)
        }
    }

    // Private

    private lazy var bgImageView: UIImageView = {
        let view = UIImageView(image: "location_guide_bg".wmc_image)
        return view
    }()

    private lazy var tipLabel: UILabel = {
        let label = UILabel()
        label.font = 14.wmc_font
        label.textColor = .wmc_white_FFFFFF
        label.textAlignment = .left
        label.numberOfLines = 2
        label.adjustsFontSizeToFitWidth = true
        label.minimumScaleFactor = 0.8
        
        let paraph = NSMutableParagraphStyle()
        paraph.lineSpacing = 4
        let attributes = [
            NSAttributedString.Key.font: UIFont.systemFont(ofSize: 13),
            NSAttributedString.Key.paragraphStyle: paraph,
        ]
        label.attributedText = NSAttributedString(string: "点击设置常用地点\n定位更精准", attributes: attributes)
        
        return label
    }()
}
